<?php

require_once('../../php/sql.php');

$p = new sql_Parser();
$fp = fopen('php://stdin', 'r');

$line = 1;
while($r = trim(fgets($fp, 4096))) { 
    try {
        $sql = $p->parse(trim($r));
        print("\n$line: OK '$r'\n");	
        print("parse:\n");
        print_r($sql);
    } catch (Exception $e) {
        print("\n$line: Error $e '$r'\n");
    }
    $line++;
}

?>
